# Contributor: Łukasz Jendrysik <scadu@yandex.com>
# Contributor: Stuart Cardall <developer@it-offshore.co.uk>
# Maintainer: Stuart Cardall <developer@it-offshore.co.uk>
pkgname=libsodium
pkgver=1.0.18
pkgrel=0
pkgdesc="P(ortable|ackageable) NaCl-based crypto library"
url="https://github.com/jedisct1/libsodium"
arch="all"
license="ISC"
subpackages="$pkgname-static $pkgname-dev"
source="https://download.libsodium.org/$pkgname/releases/$pkgname-$pkgver.tar.gz"

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr
	make
}

check() {
	make check
}

static() {
	pkgdesc="libsodium static libraries"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.a "$subpkgdir"/usr/lib/
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="17e8638e46d8f6f7d024fe5559eccf2b8baf23e143fadd472a7d29d228b186d86686a5e6920385fe2020729119a5f12f989c3a782afbd05a8db4819bb18666ef  libsodium-1.0.18.tar.gz"
